using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FinanceSectionUtilities20250118
{
    class Period: ObservableObject
{
    private string? _month = "BP";
    private bool _isSelected;

    public string Month
    {
        get => _month;
        set
        {
            if (_month != value)
            {
                _month = value;
                RaisePropertyChanged(nameof(Month));
            }
        }
    }
    public bool IsSelected
    {
        get { return _isSelected; }
        set
        {
            if (_isSelected != value)
            {
                _isSelected = value;
                RaisePropertyChanged(nameof(IsSelected));
            }
        }
    }
    public Period(string month)
    {
        Month = month;
    }
}

class Section: ObservableObject
{
    private string? _name = "All";
    private bool _isChecked;

    // 名称属性
    public string Name
    {
        get { return _name; }
        set
        {
            if (_name != value)
            {
                _name = value;
                RaisePropertyChanged(nameof(Name));
            }
        }
    }

    // 被选中的属性
    public bool IsChecked
    {
        get { return _isChecked; }
        set
        {
            if (_isChecked != value)
            {
                _isChecked = value;
                RaisePropertyChanged(nameof(IsChecked));
            }
        }
    }

    // 构造函数，用于初始化名称
    public Section(string name)
    {
        Name = name;
    }
}

    public class ObservableObject : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
